// Type: System.Data.Linq.DataContext
// Assembly: System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly location: C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.Linq.dll

using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.Linq.Mapping;
using System.IO;
using System.Linq;
using System.Reflection;

namespace System.Data.Linq
{
    public class DataContext : IDisposable
    {
        public DataContext(string fileOrServerOrConnection);
        public DataContext(string fileOrServerOrConnection, MappingSource mapping);
        public DataContext(IDbConnection connection);
        public DataContext(IDbConnection connection, MappingSource mapping);
        public DbConnection Connection { get; }
        public DbTransaction Transaction { get; set; }
        public int CommandTimeout { get; set; }
        public TextWriter Log { get; set; }
        public bool ObjectTrackingEnabled { get; set; }
        public bool DeferredLoadingEnabled { get; set; }
        public MetaModel Mapping { get; }
        public DataLoadOptions LoadOptions { get; set; }
        public ChangeConflictCollection ChangeConflicts { get; }

        #region IDisposable Members

        public void Dispose();

        #endregion

        protected virtual void Dispose(bool disposing);
        public Table<TEntity> GetTable<TEntity>() where TEntity : class;
        public ITable GetTable(Type type);
        public bool DatabaseExists();
        public void CreateDatabase();
        public void DeleteDatabase();
        public void SubmitChanges();
        public virtual void SubmitChanges(ConflictMode failureMode);
        public void Refresh(RefreshMode mode, object entity);
        public void Refresh(RefreshMode mode, params object[] entities);
        public void Refresh(RefreshMode mode, IEnumerable entities);
        public DbCommand GetCommand(IQueryable query);
        public ChangeSet GetChangeSet();
        public int ExecuteCommand(string command, params object[] parameters);
        public IEnumerable<TResult> ExecuteQuery<TResult>(string query, params object[] parameters);
        public IEnumerable ExecuteQuery(Type elementType, string query, params object[] parameters);

        protected internal IExecuteResult ExecuteMethodCall(object instance, MethodInfo methodInfo,
                                                            params object[] parameters);

        protected internal IQueryable<TResult> CreateMethodCallQuery<TResult>(object instance, MethodInfo methodInfo,
                                                                              params object[] parameters);

        protected internal void ExecuteDynamicInsert(object entity);
        protected internal void ExecuteDynamicUpdate(object entity);
        protected internal void ExecuteDynamicDelete(object entity);
        public IEnumerable<TResult> Translate<TResult>(DbDataReader reader);
        public IEnumerable Translate(Type elementType, DbDataReader reader);
        public System.Data.Linq.IMultipleResults Translate(DbDataReader reader);
    }
}
